<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script src="/lib/echarts.min.js"></script>
    <script src="/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
</head>

<body>
    <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
    <div id="main" style="width: 600px;height:400px;"></div>


    <script>
        var chartDom = document.getElementById('main');
        var myChart = echarts.init(chartDom);

        $.ajax({
            "url":"http://localhost:8080/bwash/echartsPie",
            "data":{},
            "success":function (result){
             
                option = {
                legend: {
                        top: 'bottom'
                },
                toolbox: {
                    show: true,
                feature: {
                mark: { show: true },
                dataView: { show: true, readOnly: false },
                restore: { show: true },
                saveAsImage: { show: true }
                }
                },
                series: [
                    {
                        name: 'Nightingale Chart',
                        type: 'pie',
                        radius: [50, 130],
                        center: ['50%', '50%'],
                        roseType: 'area',
                        itemStyle: {
                        borderRadius: 8
                    },
                    data:result.data.bwashPie,
                    }
                ]
            };


                myChart.setOption(option);
            },
            "dataType":"json"
        });



    </script>
</body>

</html>